home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / libdwarf / pro_util.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.1 KB  |  35 lines

  1. /*
  2.     pro_util.h 
  3.     $Revision: 1.7 $    $Date: 1993/10/18 22:31:24 $    
  4.     $Source: /cmplrs.src/v4.00/libdwarf/RCS/pro_util.h,v $
  5.  
  6.     Utility routines 
  7.  
  8. */
  9.  
  10. /* leb 128 related routines */
  11.  
  12. /* this currently encodes only unsigned numbers, need one for signed 
  13.    numbers too */
  14. char * _dwarf_pro_encode_leb128(Dwarf_Unsigned val, int *nbytes);
  15.  
  16. char * _dwarf_pro_encode_signed_leb128 (Dwarf_Signed value, int *nbytes);
  17.  
  18. void _dwarf_p_dealloc (Dwarf_P_Debug dbg, Dwarf_Small *ptr);
  19.  
  20. #define IS_64BIT(dbg)     ((dbg)->de_flags & DW_DLC_SIZE_64 ? 1 : 0)
  21.  
  22. /* definition of sizes of types, given target machine */
  23. #define sizeof_sbyte(dbg)     sizeof(Dwarf_Sbyte)
  24. #define sizeof_ubyte(dbg)    sizeof(Dwarf_Ubyte)
  25. #define sizeof_uhalf(dbg)    sizeof(Dwarf_Half)
  26. #define sizeof_uword(dbg)     \
  27.     (IS_64BIT(dbg) ? sizeof(Dwarf_Unsigned) : sizeof(Dwarf_Word))
  28. #define SIZEOF_UWORD(dbg)     \
  29.     (IS_64BIT(dbg) ? sizeof(Dwarf_Unsigned) : sizeof(Dwarf_Word))
  30. #define sizeof_sword(dbg)     sizeof_uword(dbg)
  31.  
  32. /* Computes amount of padding necessary to align n to a k-boundary. */
  33. /* Important: Assumes n, k both GREATER than zero. */
  34. #define PADDING(n, k) ( (k)-1 - ((n)-1)%(k) )
  35.